<template>
  <div class="container">
    <!-- 使用循环生成数据块 -->
    <div v-for="(item, index) in data" :key="index" class="item">
      <h3 class="title">{{ item.label }}</h3>
      <p class="text">{{ item.value }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, watchEffect } from "vue";

interface DataItem {
  label: string;
  value: string;
}
const data_arr = ref<DataItem[]>([]);
const props = defineProps({
  data: {
    type: Array as any,
    default: () => []
  }
});

watchEffect(() => {
  data_arr.value = props.data;
});
</script>

<style scoped>
.container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  text-align: center;
  border: none;
}
.item {
  text-align: center;
  border: none;
}
.title {
  font-size: 35px;
  font-weight: bold;
  color: transparent; /* 隐藏原始文字颜色 */
  background: linear-gradient(to bottom, rgb(62 121 238 / 50%), rgb(62 121 238)); /* WebKit/Blink browsers */
  background-clip: text;
}
.text {
  margin: 0;
  font-size: 30px;
  color: #ffffff;
}
</style>
